﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace JXT.PrimaryKey.Batman.Core.Extensions
{
    /// <summary>
    /// 字符串相关扩展
    /// </summary>
    public static class StringExtensions
    {
        /// <summary>
        /// 计算MD5值
        /// </summary>
        /// <param name="s">原始字符串</param>
        /// <returns>MD5字符串</returns>
        public static string ToMd5(this string s)
        {
            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(s, "MD5").ToLower();
        }
    }
}
